function RxLocationScale(x1, y1, x2, y2)
  local lx1, ly1, lx2, ly2 = x1, y1, x2, y2
  local w, h = height, width
  if sysInit.rotate == 2 then
    lx1 = x2
    ly1 = y2
    lx2 = x1
    ly2 = y1
  end
  local lastX1, lastY1, lastX2, lastY2 = 0, 0, 0, 0
  lastX1 = math.floor(w / lx1)
  lastY1 = math.floor(h / ly1)
  lastX2 = math.floor(w / lx2)
  lastY2 = math.floor(h / ly2)
  return lastX1, lastY1, lastX2, lastY2
end

function RxLocationPointScale(x1, y1)
  local x, y =  RxLocationScale(x1, y1, 0, 0)
  return x, y
end

function RxLocationTableScale(ltable)
  local x1, y1, x2, y2 = 0, 0, 0, 0
  local types = sysInit.deviceType

  if ltable and ltable.title then
    -- RxLog(tostring(ltable.title)..'___'..tostring(ltable))
  end

  local size = ltable.size
  local sizeTable
  if types == 1 then
    sizeTable = size.ios -- ios
  else
    sizeTable = size.android -- android / 模拟器
  end

  local screenScale = ltable.screenScale
  if screenScale == 0 then
    return sizeTable[1], sizeTable[2], sizeTable[3], sizeTable[4]
  else
    x1, y1, x2, y2 = RxLocationScale(sizeTable[1], sizeTable[2], sizeTable[3], sizeTable[4])
  end

  --   测试坐标
  -- fwTestSize({x1, y1, x2, y2})

  return x1, y1, x2, y2
end

function RxLocationPointTableScale(ltable)
  local x1, y1 = 0, 0
  local types = sysInit.deviceType

  local point = ltable.point
  local sizeTable
  if types == 1 then
    sizeTable = point.ios -- ios
  else
    sizeTable = point.android -- android / 模拟器
  end

  local screenScale = ltable.pointScale
  if screenScale == 0 then
    x1, y1 = sizeTable[1], sizeTable[2]
  else
    x1, y1 = RxLocationPointScale(sizeTable[1], sizeTable[2])
  end

  -- 测试坐标
  -- fwTestSize({x1, y1, x1 + 40, y1 + 40})

  return x1, y1
end
